﻿using System.Collections;
using NUnit.Framework;

namespace Dgg.LearnYourTools.NUnit.B_DataTesting.a_TestCase
{
	[TestFixture]
	public class _008_InFixtureSources
	{
		[Test, TestCaseSource("field")]
		public void TestCaseSource_ConsumesFields(int i, int j, string result)
		{
			Assert.AreEqual(result, (i + j).ToString());
		}

		internal object[] field = new object[]
		{
			new object[] {1, 2, "3"},
			new object[] {2, 2, "4"},
		};

		[Test, TestCaseSource("property")]
		public void TestCaseSource_ConsumesProperties(int i, int j, string result)
		{
			Assert.AreEqual(result, (i + j).ToString());
		}

		internal static IEnumerable property
		{
			get
			{
				yield return new object[] { 1, 2, "3" };
				yield return new object[] { 2, 2, "4" };
			}
		}
	}
}
